package com.tankgame;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: FENGYiMing
 * @Date: 2024/04/02/18:12
 * @Description:
 */
public class Bomb {
    private int x;
    private int y;
    private int live = 9;
    private boolean isLive = true;

    public Bomb(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getLive() {
        return live;
    }

    public void setLive(int live) {
        this.live = live;
    }

    public boolean isLive() {
        return isLive;
    }

    public void setLive(boolean live) {
        isLive = live;
    }

    /**
     * 减少生命值  配合出现图片的爆炸效果
     */
    public void lifeDown() {
        if (live > 0) {
            live--;

        } else {
            isLive = false;
        }
    }
}
